﻿@model RegCompanyViewModel
	<form class="layui-form" asp-controller="User" asp-action="AppendCompany" method="post">
		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">方式一：加入已有商户</div>
			<div class="layui-card-body">
				<div class="layui-form-item">
					<label class="layui-form-label">已有商户</label>
					<div class="layui-input-block">
						<select asp-for="AppendCompanyID" class="layui-input" data-val="true" data-val-required="不能为空">
							<option value="">请选择</option>
							@{
								if (Model != null && Model.CompanyList != null)
								{
									@foreach (var item in Model.CompanyList)
									{
										<option value="@item.CompanyID">@item.CompanyName</option>
									}
								}
							}
						</select>
						<span asp-validation-for="AppendCompanyID" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">加入后级别</label>
					<div class="layui-input-block">
						<select asp-for="UserType" class="layui-input" data-val="true" data-val-required="不能为空">
							<option value="2" selected="selected">管理员</option>
							<option value="3">普通成员</option>
							<option value="4">待审核成员</option>
						</select>
						<span asp-validation-for="UserType" style="color:red;"></span>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="">加入此商户</button>
						<button type="button" class="layui-btn layuiadmin-btn-list" onclick="layer_close()">取消</button>
						<input type="hidden" asp-for="UserID" />
					</div>
				</div>
			</div>
		</div>
		@Html.AntiForgeryToken()
	</form>	
	<form class="layui-form" asp-controller="User" asp-action="RegCompany" method="post">
		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">方式二：创建新商户</div>
			<div class="layui-card-body">
				@await Component.InvokeAsync("CompanyEdit", new CompanyViewModel { Company = new CompanyEntity() })
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="">创建新商户</button>
						<button type="button" class="layui-btn layuiadmin-btn-list" onclick="layer_close()">取消</button>
						<input type="hidden" asp-for="UserID" />
						<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
					</div>
				</div>
			</div>
		</div>
		@Html.AntiForgeryToken()
	</form>
	